// Automatisch generiert aus FDF
public class MyBoard
{
private Dependency1 depend1;
private Dependency2 depend2;

public MyBoard()
{
	var config = new FlowRuntimeConfiguration();
	var functionUnit1 = new FunctionUnit1();
	var functionUnit2 = new FunctionUnit2();
	var functionUnit3 = new FunctionUnit3();
	var functionUnit4 = new FunctionUnit4();
	var functionUnit5 = new FunctionUnit5();
	config.AddStreamsFrom("MyBoard.flow", typeof(MyBoard).Assembly)
		.AddEventBasedComponent("functionUnit1", functionUnit1);
		.AddEventBasedComponent("functionUnit2", functionUnit2);
		.AddEventBasedComponent("functionUnit3", functionUnit3);
		.AddEventBasedComponent("board1", new Board1(functionUnit4, functionUnit5));
		
		functionUnit2.Inject(depend1)
		functionUnit4.Inject(depend2);
		
		using (var fr = new FlowRuntime(config))
		{
			process = fr.Process;
			fr.WaitForResult(_ => 
				{
					if(_.Port == ".out")
						Result(_.Data));
					else if(_.Port == ".myResult")
						MyResult(_.Data);
				}
		}
}
public void Process(object message)
{
	process(".in", message);
}

public void MyMethod(object message)
{
	process(".myMethod", message);
}

public void Inject(Dependency1 dependency1, Dependency2 dependency2)
{
	depend1 = dependency1;
	depend2 = dependency2;
}
public Action<object>Result;

public Action<object>MyResult;
}


//Manuelle Benutzung
public class Main
{
	public static void Main()
	{
		var myBoard = new MyBoard()
		
		myBoard.Result += result => Console.WriteLine(result);
		myBoard.MyResult += result => Console.WriteLine(result);
		
		myBoard.Inject(new Dependency1(), new Dependency2());
		
		myBoard.Process("hello");
		myBoard.MyMethod("hello");
	}
}				
		
		